import request from '@/utils/request'

export default {
    //讲师列表(条件查询分页)
    //current 当前页 limit 本页的记录数  teacherQuery 查询条件对象
    getPageTeacherList(current,limit,teacherQuery){
        return request({
            url: `/eduservice/teacher/pageTeacherCondition/${current}/${limit}`,
            method: 'post',
            //teacherQuery是条件对象，后端使用Requestbody获取数据 
            //data表示把对象转换成json传递到接口中
            data: teacherQuery
          })
    },
    //讲师信息删除操作
    deleteDataById(id){
        return request({
            url: `/eduservice/teacher/${id}`,
            method: 'delete'
          })
    },
    //添加讲师
    addTeacher(teacher){
        return request({
            url: `/eduservice/teacher/addTeacher`,
            method: 'post',
            data: teacher
          })
    },
    //根据id查询讲师信息
    getTeacherById(id){
        return request({
            url: `/eduservice/teacher/getTeacher/${id}`,
            method: 'get'
          })
    },
    //根据teacher对象 更新讲师信息
    updateTeacherInfo(teacher){
        return request({
            url: `/eduservice/teacher/updateTeacher`,
            method: 'post',
            data: teacher
          })
    }
}

